<template>
  <div>
    <div v-for="index in 11" class="moremore" :key="index">
      <span v-show="item.lc_type !== 'bx'&&list[index -1] !='' " v-if="type && (index ==4 || index==6) " class="moreTitle" v-text="type?tableTitle[index-1]:tableTitle1[index-1]" style="paddingLeft:.8rem"></span>
      <!-- 总收益后面的?号标 -->
      <div placement="right" v-else-if="index == 3" style="position:relative" @click="showN" v-show="item.lc_type !== 'bx' &&list[index -1] !=''" >
        <Note :showNote="showNote"></Note>
        <span class="moreTitle" v-text="type?tableTitle[index-1]:tableTitle1[index-1]"></span>
        <x-icon type="ios-help" size="15" v-show="type"></x-icon>
      </div>
      <!-- 返利是0的隐藏 -->
      <span v-show="item.cp_fl != 0 &&list[index -1] !=''" v-else-if="type&&index == 5" class="moreTitle" v-text="type?tableTitle[index-1]:tableTitle1[index-1]" style="paddingLeft:.8rem" ></span>
      <span v-show="item.lc_type !== 'bx' &&list[index -1] !=''" v-else-if="index > 7 && index < 11" class="moreTitle" v-text="type?tableTitle[index-1]:tableTitle1[index-1]" ></span>
      <span v-show="item.lcType !='bx'&&list[index -1] !=''" v-else-if="!type&&index ==1" class="moreTitle" v-text="type?tableTitle[index-1]:tableTitle1[index-1]" ></span>
      <span v-show="item.lcType !='bx'||(list[index -1] !=''&&list[index-1] != '0.00%')" v-else class="moreTitle" v-text="type?tableTitle[index-1]:tableTitle1[index-1]"></span>
      
      <!-- 表格内容 -->
      <span v-show="list[list-1] == ''||item.lc_type !== 'bx' " class="moreContent" v-if="type && (index == 3||index==4||index==6)" :style="{color:color}" v-text="list[index-1]"></span>
      <!-- 返利是0的隐藏 -->
      <span v-show="list[list-1] == ''||item.cp_fl != 0 " v-else-if="type&&index == 5" class="moreContent" v-text="list[index-1]" :style="{color:color}" ></span>
      <span v-show="list[list-1] == ''||item.lc_type !='bx'" v-else-if="index > 7 && index < 11" class="moreContent" v-text="list[index-1]"></span>
      <span v-show="list[list-1] == ''||item.lc_type !='bx'" v-else-if="!type&&index ==1" class="moreContent" v-text="list[index-1]"></span>
      <span v-else class="moreContent" v-text="list[index-1]" ></span>
    </div>
  </div>
</template>
<script>
import Note from '../../pages/productDetail/children/Note'
import { getStore} from '../../../config/mUtils';

export default {
  components:{
    Note
  },
  data(){
    return {
      color: '#dd3930',
      tableTitle:['起投金额','投资期限','总收益','利息','返利','红包','返利时间','债权转让','起息日','利息管理费','限额'],
      tableTitle1:['平台背景','上线时间','所在地','主营业务','银行存管','平台用户量级','成交额度','提现费用','利息管理费','债权转让'],
      showNote:false,
    }
  },
  props:['item','type'],
  computed:{
    list(){
      let list = []
      if(this.type){
        list.push(parseInt(this.item.qtje)+'元')
        if(this.item.cp_tzqxlx == 'day'){
          list.push(this.item.qixian+'天')
        }else{
          list.push(this.item.qixian+'个月')
        }
          list.push(this.item.cp_zsy)
        if(this.item.cp_type == 2){
          list.push(`${this.item.cp_lx}%`)
          list.push(this.item.cp_fl+'%')
          list.push(this.item.cp_hb+'%')
        }else{
          list.push(this.item.cp_lx+'元')
          list.push(this.item.cp_fl+'元')
          list.push(this.item.cp_hb+'元')
        }
        list.push(this.item.cp_flsj)
        list.push(this.item.cp_zqzr)
        list.push(this.item.cp_qxr)
        list.push(this.item.cp_lxglf)
        list.push(parseInt(this.item.cp_xiane)+'元')
      }else{
        list.push(this.item.ptbj)
        list.push(this.item.sxsj)
        list.push(this.item.szd)
        list.push(this.item.zyyw)
        list.push(this.item.yhcg)
        list.push(this.item.yhlj)
        list.push(this.item.cjed)
        list.push(this.item.txfy)
        list.push(this.item.lxglf)
        list.push(this.item.zqzr)
      }
      return list
    },
  },
  methods:{
    showN(){
      this.showNote = !this.showNote
      // console.log(this.showNote);
    },
    isEmpty(str){
      if(str == ''){
        return false
      }
      
    }
  }
}
</script>
<style lang="less">
@import '../../../style/mixin.less';

  .moremore{
    .fx(row);
    .moreTitle{
      display: inline-block; 
      box-sizing: border-box;
      padding-left: .2rem;
      width: 2.7733rem;
      height: 0.8933rem;
      line-height: 0.8933rem;
      color: #cbcbcb;
      font-size: 0.3467rem;
      // background-color: burlywood
    }
    .moreContent{
      font-size: 0.3467rem;
      width: 68%;
      display: inline-block;
    }
    .vux-x-icon {
      fill: #e06c61 ;
      position: absolute;
      top: 25%;
      left:46%;
    }
  }
  .moremore:nth-child(odd){
    background-color: #f9f9f9;
  }
  .vux-popover{
    // position: relative !important;
    
  }
</style>
